<template>
  <el-dialog
    :visible="showDialog"
    :append-to-body="true"
    :close-on-click-modal="false"
    :title="`协议-${commandData.protocolName}`"
    width="900px"
    @close="dialogCancel">
    <el-table :data="commandData.commands" border class="mar-btm">
      <el-table-column prop="commandNo" label="命令编号"></el-table-column>
      <el-table-column prop="commandName" label="命令名称"></el-table-column>
      <el-table-column prop="methodName" label="方法名称"></el-table-column>
    </el-table>
    <div class="flex-justify-end">
      <el-button type="primary" class="mar-lft-10" @click="dialogCancel"><span class="mar-lft-rgt-10">关闭</span>
      </el-button>
    </div>
  </el-dialog>
</template>
<script>
  export default {
    name: 'GlobalCommand',
    model: {
      prop: 'showDialog',
      event: 'change'
    },
    props: {
      commandData: {
        type: Object,
        default: () => {},
      },
      showDialog: {
        type: Boolean,
        default: false,
      },

    },
    methods: {
      dialogCancel() {
        this.$emit('change', false);
      },
    }
  }
</script>
